/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package upr.daos;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import upr.entidades.Departamento;

/**
 *
 * @author Claudivan Alves
 */
public class DepartamentoDAO {
    private Connection connection;
    private PreparedStatement statement;

    public DepartamentoDAO() throws SQLException {
        this.connection = ConnectionFactory.getInstance().getConnection();
        this.statement = null;
    }

    public void insertDepartamento(Departamento departamento) throws SQLException {
        String query = "INSERT INTO curso(nome) VALUES (?);";
        this.statement = this.connection.prepareStatement(query);
        this.statement.setString(1, departamento.getNome());
        this.statement.executeUpdate();
    }

}
